package l1j.opqlo.Server.etcitem;

import l1j.server.server.model.Instance.L1ItemInstance;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.serverpackets.S_ItemName;

public class Light {

	/** 照明類道具 */

	// } else if (l1iteminstance.getItem().getType() == 2) { // light系アイテム

	public static void begin(final L1PcInstance pc,
			final L1ItemInstance l1iteminstance) {

		if (l1iteminstance.getRemainingTime() <= 0
				&& l1iteminstance.getItemId() != 40004) {
			return;
		}
		if (l1iteminstance.isNowLighting()) {
			l1iteminstance.setNowLighting(false);
			pc.turnOnOffLight();
		} else {
			l1iteminstance.setNowLighting(true);
			pc.turnOnOffLight();
		}
		pc.sendPackets(new S_ItemName(l1iteminstance));

	}
}
